<?php

/**
 * DocEntete filter form base class.
 *
 * @package    symfony
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseDocEnteteFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'date'                       => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'reference'                  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'lieu_livraison'             => new sfWidgetFormFilterInput(),
      'observation'                => new sfWidgetFormFilterInput(),
      'taux_remise'                => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'total_h_t'                  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'total_remise'               => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'total_t_v_a'                => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'total_t_t_c'                => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'timbre'                     => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'date_livraison'             => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'date_validite'              => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'duree_validite'             => new sfWidgetFormFilterInput(),
      'cloture'                    => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'livrer'                     => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'domaine'                    => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'type'                       => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'mode_paiement'              => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'id_contact'                 => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Contact'), 'add_empty' => true)),
      'id_tiers'                   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Tiers'), 'add_empty' => true)),
      'id_departement_source'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('DepartementSource'), 'add_empty' => true)),
      'id_departement_destination' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('DepartementDestination'), 'add_empty' => true)),
      'id_representant'            => new sfWidgetFormFilterInput(),
      'taux_escompte'              => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'num_attestation_timbre'     => new sfWidgetFormFilterInput(),
      'date_creation'              => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'statut'                     => new sfWidgetFormFilterInput(),
      'id_conducteur'              => new sfWidgetFormFilterInput(),
      'id_coconducteur'            => new sfWidgetFormFilterInput(),
      'id_vehicule'                => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Vehicule'), 'add_empty' => true)),
      'confirme'                   => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'valider'                    => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'id_affaire'                 => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Affaire'), 'add_empty' => true)),
      'brouillon'                  => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'date_changement_etat'       => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'id_adresse'                 => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Adresse'), 'add_empty' => true)),
      'etat_reglement'             => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'supprimer'                  => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'motif'                      => new sfWidgetFormFilterInput(),
      'numero_sequence'            => new sfWidgetFormFilterInput(),
      'nature'                     => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'avance_sur_impot'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'date_debut_periode'         => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'date_fin_periode'           => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'total_fodec'                => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'journal_caisse'             => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'created_at'                 => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'updated_at'                 => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
    ));

    $this->setValidators(array(
      'date'                       => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'reference'                  => new sfValidatorPass(array('required' => false)),
      'lieu_livraison'             => new sfValidatorPass(array('required' => false)),
      'observation'                => new sfValidatorPass(array('required' => false)),
      'taux_remise'                => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'total_h_t'                  => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'total_remise'               => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'total_t_v_a'                => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'total_t_t_c'                => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'timbre'                     => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'date_livraison'             => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'date_validite'              => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'duree_validite'             => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'cloture'                    => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'livrer'                     => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'domaine'                    => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'type'                       => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'mode_paiement'              => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'id_contact'                 => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Contact'), 'column' => 'id')),
      'id_tiers'                   => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Tiers'), 'column' => 'id')),
      'id_departement_source'      => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('DepartementSource'), 'column' => 'id')),
      'id_departement_destination' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('DepartementDestination'), 'column' => 'id')),
      'id_representant'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'taux_escompte'              => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'num_attestation_timbre'     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'date_creation'              => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'statut'                     => new sfValidatorPass(array('required' => false)),
      'id_conducteur'              => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'id_coconducteur'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'id_vehicule'                => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Vehicule'), 'column' => 'id')),
      'confirme'                   => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'valider'                    => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'id_affaire'                 => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Affaire'), 'column' => 'id')),
      'brouillon'                  => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'date_changement_etat'       => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'id_adresse'                 => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Adresse'), 'column' => 'id')),
      'etat_reglement'             => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'supprimer'                  => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'motif'                      => new sfValidatorPass(array('required' => false)),
      'numero_sequence'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'nature'                     => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'avance_sur_impot'           => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'date_debut_periode'         => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'date_fin_periode'           => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'total_fodec'                => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'journal_caisse'             => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'created_at'                 => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'updated_at'                 => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('doc_entete_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'DocEntete';
  }

  public function getFields()
  {
    return array(
      'id'                         => 'Number',
      'date'                       => 'Date',
      'reference'                  => 'Text',
      'lieu_livraison'             => 'Text',
      'observation'                => 'Text',
      'taux_remise'                => 'Number',
      'total_h_t'                  => 'Number',
      'total_remise'               => 'Number',
      'total_t_v_a'                => 'Number',
      'total_t_t_c'                => 'Number',
      'timbre'                     => 'Boolean',
      'date_livraison'             => 'Date',
      'date_validite'              => 'Date',
      'duree_validite'             => 'Number',
      'cloture'                    => 'Boolean',
      'livrer'                     => 'Boolean',
      'domaine'                    => 'Boolean',
      'type'                       => 'Boolean',
      'mode_paiement'              => 'Boolean',
      'id_contact'                 => 'ForeignKey',
      'id_tiers'                   => 'ForeignKey',
      'id_departement_source'      => 'ForeignKey',
      'id_departement_destination' => 'ForeignKey',
      'id_representant'            => 'Number',
      'taux_escompte'              => 'Number',
      'num_attestation_timbre'     => 'Number',
      'date_creation'              => 'Date',
      'statut'                     => 'Text',
      'id_conducteur'              => 'Number',
      'id_coconducteur'            => 'Number',
      'id_vehicule'                => 'ForeignKey',
      'confirme'                   => 'Boolean',
      'valider'                    => 'Boolean',
      'id_affaire'                 => 'ForeignKey',
      'brouillon'                  => 'Boolean',
      'date_changement_etat'       => 'Date',
      'id_adresse'                 => 'ForeignKey',
      'etat_reglement'             => 'Boolean',
      'supprimer'                  => 'Boolean',
      'motif'                      => 'Text',
      'numero_sequence'            => 'Number',
      'nature'                     => 'Boolean',
      'avance_sur_impot'           => 'Number',
      'date_debut_periode'         => 'Date',
      'date_fin_periode'           => 'Date',
      'total_fodec'                => 'Number',
      'journal_caisse'             => 'Boolean',
      'created_at'                 => 'Date',
      'updated_at'                 => 'Date',
    );
  }
}
